package com.mjw.zstu.controller;

import com.mjw.zstu.entity.Message;
import com.mjw.zstu.resultDto.JsonResult;
import com.mjw.zstu.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("message")
public class MessageController {
    @Autowired
    MessageService messageService;
    @RequestMapping("list")
    public JsonResult getlist(@RequestBody Message message){
       return messageService.getlist(message);
    }
    @RequestMapping("read")
    public JsonResult read(@RequestBody Message message){
        return messageService.read(message);
    }
}
